<%-- 
    Document   : admin_Student_details
    Created on : 2020-5-31, 10:56:01
    Author     : liqianru
--%>

<%@page import="java.util.List"%>
<%@page import="com.web.entity.Grade"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="css/bootstrap.min.css"/>
        <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
        <!--主要样式-->
        <link rel="stylesheet" type="text/css" href="css/style.css" />
        <link rel="stylesheet" href="css/bootstrap.min.css"/>
        <link rel="stylesheet" href="css/mycss_foradim.css"/>
        <script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
        <script type="text/javascript" src="js/bootstrap.min.js"></script>
        <script src="js/RGraph.common.core.js"></script>
        <script src="js/RGraph.common.dynamic.js"></script>
        <script src="js/RGraph.common.tooltips.js"></script>
        <script src="js/RGraph.line.js"></script>
        <script type="text/javascript" src="js/circle.js" charset="UTF-8"></script>

        <title>学生详情</title>
    </head>
    <body>

        <div id="navdiv">
            <div class="top_navdiv">
                <div class="top_left">管理员中心</div>
                <div class="identity">
                    <span class="message">您好</span><span class="redpoint">1</span>
                    <div class="user_li">
                        <canvas id="myCanvas" width="100" height="30">
                        </canvas>
                    </div>
                    <div class="nd_menu">
                        <ol>
                            <li>回到首页</li>
                            <li><a href="#" onclick="all_logout()">退出登录</a></li>
                            <li id="status_li"><a onclick="refresh()" href="#" data-target="#myModal_status" data-toggle="modal">申请信息</a><span class="redpoint" id="status_span">1</span></li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
        <div class=" control_nav ">
            <div class="container">
                <ul class="nav navbar-nav navul">

                                     <li class="col-md-2 nav_li">
                        <a href="#"><img class="nav_img" src="img/nav6.png"/> 教师</a>
                        <div class="nav_underline" style="display: none;"></div>
                    </li>
                    <li class="col-md-2 nav_li">
                        <a href="#"><img class="nav_img" src="img/nav1.png"/> 班级</a>
                        <div class="nav_underline" style="display: none;"></div>
                    </li>
                    <li class="col-md-2">
                        <a href="getallStu?action=getall"><img class="nav_img" src="img/nav5.png"/> 学生</a>
                        <div class="nav_underline" style="display: none;"></div>
                    </li>
                    <li class="col-md-2">
                        <a href="getallCourse?action1=getall"><img class="nav_img" src="img/nav3.png"/> 课程</a>
                        <div class="nav_underline" style="display: none;"></div>
                    </li>
                    <li class="col-md-2">
                        <a href="getallschedule"><img class="nav_img" src="img/nav2.png"/> 带课</a>
                        <div class="nav_underline" style="display: none;"></div>
                    </li>
                    <li class="col-md-2">
                        <a href="getTest?action=get"><img class="nav_img" src="img/nav4.png"/> 题目</a>
                        <div class="nav_underline" style="display: none;"></div>
                    </li>
                </ul>

            </div>

        </div> 
        <main>
            <ul class="S_details">
                <li><img src="img/studenticon.png"/></li>

            </ul>
            <ul class="name_list">
                <li class="stitle"><span class="name">${requestScope.onestudent.sname}</span><span class="signature">好好学习 天天向上</span></li>
                <li class="S_detail"><a onclick="diplay_first()" href="#"><b>个人信息</b></a><div class="line_first"></div></li>
                <li class="S_detail"><a  onclick="diplay_second()" href="#"><b>课程信息</b></a><div class="line_second"></div></li>
                <button class="check_btn" title="点击查看历史最高七次成绩" onclick="showGrade()">查看成绩</button>

            </ul>
            <div class="grade_canvas">
                <canvas id="gradeGraph" width="300" height="300">[No canvas support]</canvas>
                <a href="javascript:hideGrade();" title="点击收起"><span class="glyphicon glyphicon-chevron-up grade_canvas_span"></span></a>
            </div>
            <table class="mytable oneStable" id="Stu_table_details">
                <thead class="thead">
                    <tr class="col_head">
                        <th>学号</th><td> ${requestScope.onestudent.sid}</td>
                    </tr>
                    <tr class="col_head">
                        <th>姓名</th><td> ${requestScope.onestudent.sname}</td>
                    </tr>
                    <tr class="col_head">
                        <th>密码</th><td> ${requestScope.onestudent.spwd}</td>
                    </tr>
                    <tr class="col_head">
                        <th>性别</th><td> ${requestScope.onestudent.sgender}</td>
                    </tr>
                    <tr class="col_head">
                        <th>班级ID</th><td> ${requestScope.onestudent.classID}</td>
                    </tr>
                </thead>
            </table>
            <table class="mytable oneStable" id="Cou_table_details">
                <thead class="thead">
                    <tr class="col_head">
                        <th>班级名</th>
                        <th>课程名</th>
                        <th>带课教师</th>
                        <th>课程号</th>
                        <th>教师号</th>
                    </tr>
                </thead>
                <tbody>
                    <c:forEach items="${requestScope.oneCourselist}" var="c">
                        <tr>
                            <td>${c.className}</td>
                            <td>${c.courseName}</td>
                            <td>${c.teacherName}</td>
                            <td>${c.courseId}</td>
                            <td>${c.tid}</td>
                        </tr>
                    </c:forEach>
                </tbody>
            </table>


        </main>
    </body>
    <script>
        //显示图表信息
        $(document).ready(function () {
            date = ["${requestScope.gradelist[0].courseName}", "${requestScope.gradelist[1].courseName}", "${requestScope.gradelist[2].courseName}",
                "${requestScope.gradelist[3].courseName}", "${requestScope.gradelist[4].courseName}", "${requestScope.gradelist[5].courseName}",
                "${requestScope.gradelist[6].courseName}"];
            grade = ["${requestScope.gradelist[0].grade}", "${requestScope.gradelist[1].grade}", "${requestScope.gradelist[2].grade}",
                "${requestScope.gradelist[3].grade}", "${requestScope.gradelist[4].grade}", "${requestScope.gradelist[5].grade}",
                "${requestScope.gradelist[6].grade}"];
            tooltips = [];
            color = '#D10A11';
            grade.forEach(function (v, k, arr) {
                tooltips[k] = '{1}<p align="center"><b>{2}</b></p>'.format(
                        date[k],
                        grade[k],
                        //grade[k];

                        //RGraph.random(300, 500)
                        );

            });
            var line = new RGraph.Line({
                id: 'gradeGraph',
                data: [${requestScope.gradelist[0].grade}, ${requestScope.gradelist[1].grade},${requestScope.gradelist[2].grade},
        ${requestScope.gradelist[3].grade}, ${requestScope.gradelist[4].grade}, ${requestScope.gradelist[5].grade},
        ${requestScope.gradelist[6].grade}],
                options: {
                    //xaxisLabels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
                    yaxisScaleMax: 100,
                    marginLeft: 35,
                    marginRight: 35,

                    tooltips: function (index)
                    {
                        return tooltips[index];
                    },
                    colors: [color]
                }
            }).draw().on('tooltip', function (obj) {
                var tooltip = RGraph.Registry.get('tooltip');
                tooltip.style.borderColor = obj.get('colors')[0];
            });
        });

        history.pushState(null, null, document.URL);
        window.addEventListener('popstate', function () {
            history.pushState(null, null, document.URL);
        });
    </script>
</html>
